import request from "@/utils/request";

// 获取列表信息
export function list(query) {
  return request({
    url: "/aitcommon/aitconfig/list",
    method: "get",
    params: query
  });
}

// 获取目录信息
export function dir() {
  return request({
    url: "/aitcommon/aitconfig/dir",
    method: "get",
  });
}

// 重新加载文件配置
export function reload() {
  return request({
    url: "/aitcommon/aitconfig/reload",
    method: "get",
  });
}

// 运行配置
export function run(flowCode) {
  return request({
    url: "/aitcommon/aitconfig/run",
    method: "get",
    params:{flowCode},
  });
}

// 读取日志文件
export function loadLogFile(type,num) {
  return request({
    url: "/aitcommon/aitconfig/loadLogFile",
    method: "get",
    params:{type,num},
  });
}

// 运行信息
export function loadRunTimeInfo(flowCode) {
  return request({
    url: "/aitcommon/runtime/loadInfo",
    method: "get",
    params:{flowCode},
  });
}

// 运行信息
export function loadRunSQLInfo(flowCode) {
  return request({
    url: "/aitcommon/runtime/loadSQLInfo",
    method: "get",
    params:{flowCode},
  });
}

// 加载rest信息
export function loadRunCallInfo(flowCode) {
  return request({
    url: "/aitcommon/runtime/loadCallInfo",
    method: "get",
    params:{flowCode},
  });
}

// 加载rest信息
export function loadLogCallInfo(logID) {
  return request({
    url: "/aitcommon/aitlog/loadCallInfo",
    method: "get",
    params:{logID},
  });
}

// rest 调用
export function restCallRun(restCall) {
  // console.info('restCallRun:',restCall);
  return request({
    url: "/aitcommon/runtime/restCallRun",
    method: "get",
    params:restCall,
  });
}
